#ifndef BOOK_H
#define BOOK_H
#include<QString>
#include<QDate>
#include<QVector>
enum Book_state
{
    Lending = 1,//借出
    Not_Lending = 2,//未借出
    Lost = 3, //丢失
    Destroyed = 4,//毁坏
    Damage = 5//破损
};

class Vectorbook{
public:
    Vectorbook();
    Vectorbook(const Vectorbook& book);
    Vectorbook& operator=(const Vectorbook& book);
    Vectorbook(QStringList data);
    Vectorbook(QString number);//新设置书
    Vectorbook(QString number, Book_state state, QString Reamarks);
public:
    Book_state book_state;//书本状态
    QString book_number;//书本唯一标识符
    QString book_Remarks;//备注
};

class Book
{
public:
    Book();
    Book(const Book& bok);
    Book(QStringList data);
    Book& operator=(const Book& bok);
    Book(QString number, QString ISBN, QString name,QString writer, float price,size_t num,QDate PublishTime,QString PublishUnit);//用于新添加图书信息
//    Book(QString number, QString ISBN, QString writer, float price,size_t num,QDate PublishTime,QString PublishUnit,QVector<Vectorbook> array);//用于从文件读取
    QVector<Vectorbook> BuildBookNumber(QString number,size_t num);
    QStringList getBook();
public:
    QString book_number;//图书登记号
    QString book_ISBN;//书号（ISBN）
    QString book_name;//书名
    QString book_writer;//作者
    float book_price;//单价
    size_t book_num;//库存数量
    QDate book_PublishTime;//出版时间
    QString book_PublishUnit;//出版单位
    QVector<Vectorbook> book_array;
};

#endif // BOOK_H
